from selenium import webdriver
import time

url = 'https://www.so.com/'

driver = webdriver.Chrome();
driver.get(url)

# 定位到输入框，输入，擦除，在输入
el = driver.find_element_by_id('input')
el.send_keys('python')
time.sleep(3)
el.clear()
time.sleep(3)
el.send_keys('itcast')

el_sub = driver.find_element_by_id('search-button')
# el_sub.click()
el_sub.submit()

time.sleep(5)
driver.quit()